class_name RoundAutoReadySys
extends System

const CATCH_READ = []

var catch_read := []


func _init():
	system_name = "RoundAutoReadySys"
	listen_modify("auto_ready", "GlobalRound", ["GlobalRound", "GlobalReady"])


func _system_ready():
	catch_read = world.query_manager.fetch_components(CATCH_READ)


func auto_ready(_e, read: Array):
	var round_c = read[0].data as GlobalRound
	var ready_c = read[1].data as GlobalReady
	ready_c._round = round_c.count
